package com.workcell.workdata.xthings.api.feign;

import com.workcell.workdata.common.core.constant.SecurityConstants;
import com.workcell.workdata.common.core.util.R;
import com.workcell.workdata.open.dto.WebSocketMessageDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author 廖博文
 * @Date 2023/2/11 16:53
 * @Description
 */
@FeignClient(contextId = "remoteDmdService", value = "iot-open-biz")
public interface RemoteIotOpenService {


	@PostMapping("/iot/webSocket/sendTo")
	R sendTo(@RequestBody WebSocketMessageDto webSocketMessageDto);

	@ResponseBody
	@PostMapping("/iot/webSocket/sendVoicePlaybackOne")
	R sendVoicePlaybackOne(@RequestBody Map<String,String> map);

	@ResponseBody
	@PostMapping("/iot/webSocket/sendVoicePlaybackAll")
	R sendVoicePlaybackAll(@RequestBody Map<String,String> map);

	@ResponseBody
	@GetMapping("/iot/webSocket/getOnLineAllUser")
	R getOnLineAllUser();

	@ResponseBody
	@GetMapping("/iot/webSocket/getOnLineAllUserByInnerSvc")
	R getOnLineAllUserByInnerSvc(@RequestHeader(SecurityConstants.FROM) String from);

	@ResponseBody
	@GetMapping("/iot/webSocket/removeUser/{userId}")
	R removeUser(@PathVariable("userId") String userId);

	@GetMapping("/iot/webSocket/getTvVersion/{userId}")
	R<String> getTvVersion(@PathVariable("userId") String userId);
}
